import 'package:miuu_note_app/model/snippet_entity.dart';

import '../model/todo_entity.dart';
import 'diary_entity.dart';
import 'msg_entity.dart';

class EntityFactory {
  static T? generateOBJ<T>(dynamic json) {
    if (1 == 0) {
      return null;
    } else if (T.toString() == "TodoListEntity") {
      return TodoListEntity.fromJson(json) as T;
    } else if (T.toString() == "SnippetPageEntity") {
      return SnippetPageEntity.fromJson(json) as T;
    } else if (T.toString() == "SnippetEntity") {
      return SnippetEntity.fromJson(json) as T;
    } else if (T.toString() == "DiaryEntity") {
      return DiaryEntity.fromJson(json) as T;
    } else if (T.toString() == "DiaryListEntity") {
      return DiaryListEntity.fromJson(json) as T;
    } else if (T.toString() == "MsgEntity") {
      return MsgEntity.fromJson(json) as T;
    } else {
      return null;
    }
  }
}
